package com.zzyl.nursing.mapper;

import java.time.LocalDateTime;
import java.util.List;

import com.zzyl.nursing.domain.Device;
import com.zzyl.nursing.domain.FamilyMemberElder;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zzyl.nursing.vo.MemberElderVo;
import com.zzyl.nursing.vo.member.DeviceDataMapVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 客户老人关联Mapper接口
 * 
 * @author ruoyi
 * @date 2024-09-28
 */
@Mapper
public interface FamilyMemberElderMapper extends BaseMapper<FamilyMemberElder>
{
    /**
     * 查询客户老人关联
     * 
     * @param id 客户老人关联主键
     * @return 客户老人关联
     */
    public FamilyMemberElder selectFamilyMemberElderById(Long id);

    /**
     * 查询客户老人关联列表
     * 
     * @param familyMemberElder 客户老人关联
     * @return 客户老人关联集合
     */
    public List<FamilyMemberElder> selectFamilyMemberElderList(FamilyMemberElder familyMemberElder);

    /**
     * 新增客户老人关联
     * 
     * @param familyMemberElder 客户老人关联
     * @return 结果
     */
    public int insertFamilyMemberElder(FamilyMemberElder familyMemberElder);

    /**
     * 修改客户老人关联
     * 
     * @param familyMemberElder 客户老人关联
     * @return 结果
     */
    public int updateFamilyMemberElder(FamilyMemberElder familyMemberElder);

    /**
     * 删除客户老人关联
     * 
     * @param id 客户老人关联主键
     * @return 结果
     */
    public int deleteFamilyMemberElderById(Long id);

    /**
     * 批量删除客户老人关联
     * 
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteFamilyMemberElderByIds(Long[] ids);

    String getRoom(String bedNumber);

    Device getDevice(Long id);

    /**
     *联表查老人信息
     * @param userId
     * @return
     */
    List<MemberElderVo> queryFamilies(Long userId);

    /**
     * 1.5  按天统计查询指标数据
     * @return
     */
    List<DeviceDataMapVo> queryDeviceDataListByDay(@Param("iotId") String iotId, @Param("functionId") String functionId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);

    /**
     * 1.6  按周统计查询指标数据
     * @return
     */
    List<DeviceDataMapVo> queryDeviceDataListByWeek(@Param("iotId") String iotId, @Param("functionId") String functionId, @Param("startTime") LocalDateTime startTime, @Param("endTime") LocalDateTime endTime);
}
